[ Search |  Up Level |  Project home |  Index |  Class hierarchy ]

 Objective.ox

Objective is the base class for defining what to optimize or solve.

The base and derived objective classes are documented here. Click on "Hierarchy" on the menu bar to see them organized in a logical order.

 Global enumerations

Enumerations
 MixedWeightOptions Tags weighting options.
 QuasiAlgorithms Tags for Gradient-based optimization algorithms.

 BlackBox : UnConstrained : Objective

Represents a blacbox objective.

This is the container class for a standard function to maximize.

A BlackBox has no internal structure (such as separability of parameters).
Public methods
 BlackBox Create a blackbox objective.

Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vfunc, vobj
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 CES : BlackBox : UnConstrained : Objective

Constant elasticity of subsitution function.
Public fields
 A
 alphas
 elast
 x
 xpon
Public methods
 CES Create a constant elasticity of subsitution objective.
 vfunc virtual Compute CES.
Inherited methods from BlackBox:
BlackBox
Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vobj
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 CobbDouglas : BlackBox : UnConstrained : Objective

Cobb-Douglas objective. $$f = A \prod_{i=0}^{N^-} x_i ^{\alpha_i}.$$

\(A\) and \(\alpha\) are CV-compatible objects.
Public fields
 A
 alphas
 x
Public methods
 AnalyticGradient virtual
 CobbDouglas Create a CobbDouglas objective.
 vfunc virtual \(A{\prod}_{i=1}^N x_i^{\alpha_i}\).

Inherited methods from BlackBox:
BlackBox
Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vobj
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 Constrained : Objective

Container for Constrained Objectives.
Public methods
 CheckPoint virtual Store current state of a Constrained Objective (checkpoint to disk).
 Constrained Create a constrained objective.
 equality virtual Default Equality Constraints.
 funclist Compute the objective and constraints at multiple points.
 Gradient virtual Compute the ∇f(), objective's gradient at the current vector.
 inequality virtual Default InEquality Constraints.
 Jacobian virtual Compute the Jg(), vector version of the Lagrangian's Jacobian at the current vector.
 Lagrangian Decode the input, return the whole vector, inequality and equality constraints, if any.
 Merit virtual
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, contour, Decode, Encode, fobj, FreeStatus, Hessian, Interact, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vfunc, vobj
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 CPoint

Public methods
 Vec

 DataObjective : BlackBox : UnConstrained : Objective

Base class for automatically generated econometric objectives: likelihood functions and GMM objective.

This objective takes a "data" object that is typically either a OutcomeDataSet or a PredictionDataSet.
Public fields
 data const path or prediction object.
 stage estimation stage.
 tplist transition parameters .
 uplist utility parameters .
Public methods
 DataObjective An objective based on an economic model with data and (possibly) a nested solution method.
 SetStage Set the estimation stage.
 TwoStage Specify the objective as two stage.
 vfunc virtual Calls and returns data->EconometricObjective() or uses SemiClosedForm() if in Gradient calculation.

Inherited methods from BlackBox:
BlackBox
Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vobj
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 Equilibrium : System : Objective

A nonlinear system for computing equilibrium. This provides a framework for equilibrium prices in a model with an aggregate production function.
\(T\) periods (default \(T=1\))
Production
A \(N\times 1\) vector \(X.\)
\(F(X^d)\) is aggregate output where \(X^s\) stands for aggregate demand.
\(p_t\) is a \(n\times 1\) price vector in period \(t\).
The respresentative firm acts to maximize static profit by choosing \(X^d_\) accounting for input prices and a depreciation vector \(\Delta\). First order conditions at \(t\) are: $$\nabla F(X^d_t)^\prime - \Delta - p_t = \overrightarrow{0}$$ where \(\nabla F\) is the \(1\times N\) gradient of the production function with respect to \(X^d_t\).
Households
Consumer behavior is described by a DP with \(T\) periods. If the clock is ergodic then it is a stationary equilibrium for infinitely lived agents. If the clock is non-stationary then it is a sequence of \(T\) static equilibrium problems which are connected because agent behavior at \(t\) depends on future prices and past choices through the current distribution across states. (This version does not handle overlapping generations.)
Adding variables to \(\gamma_r\) (random effects) allows for heterogeneity. (This version does not allow fixed effects.)
The price matrix \(p\) enters \(U()\), usually through a budget constraint that determines consumption.
Quantities of per-capita values supplied by households (\(X^s\)) are determined by the predicted amounts : $$X^s_t = \sum_{\gamma_r}g(r)\left[ \sum_{\theta\in\Theta} f_t(\theta;\gamma_r) x_t(\theta;\gamma_r)\right].$$ Here \(x_t(\theta;\gamma_r)\) is the vector of elements of of the DP outcome \(Y\) that match up to the factors of production. \(f_t\) is the distribution over states at \(t.\) The user specifies the intial distribution \(f_0\). If the equilibrium is stationary then this is the ergodic distribution \(f_\infty\).
A fixed factor can be included by adding a constant AuxiliaryOutcome to to the DP, which would then always average across states and household types to the fixed factor.
In other words, \(X^s_t\) are computed from the PathPrediction of length \(T\) starting from exogenous initial conditions.
Equilibrium
In equilibrium the price vector \(p^\star_t\) satisfies the first order conditions when \(X^s\) is inserted for \(X^d\) at each \(t.\)
In general, the full price vector \(p^\star\) is the solution to a system of \(TN\) equations. Depending on the production fucntion \(f(X)\) some of the equations may be solved out to reduce the number of equations. In that case some elements of \(p^\star\) are Determined parameters not available for the system algorithm to vary.
Public fields
 aggF const list of aggregate prod.
 deprec const 0.0 or vector of quantity depreciations.
 foc computed system.
 Q aggregate Qs from prediction.
 Qcols const columns of pred that match up to inputs.
 stnpred const ergodic distribution PathPrediction.
 T const number of periods in equilibrium.
Public methods
 Equilibrium Create a system of aggregate equilibrium equations.
 Print Prints a message and details about the objective.
 vfunc virtual Built-in system of equations for Equilibrium models.
Inherited methods from System:
EndOneDim, equations, SetOneDim, System
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Gradient, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vobj
Inherited fields from System:
eq1, normexp
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 GHKMNP : MNP : MultiNomialChoice : BlackBox : UnConstrained : Objective

Correlated MNP using GHK .
Public fields
 ghk const
 sigfree const
 SigLT const
Public methods
 GHKMNP GHK based objective for MNP log likelihood.
 SetGHK
 vfunc Compute and return the vector of log-likelihoods at the current parameters.
Enumerations
 Anonymous enum 1
Inherited methods from MultiNomialChoice:
Estimate, MultiNomialChoice, SetD
Inherited methods from BlackBox:
BlackBox
Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vobj
Inherited fields from MultiNomialChoice:
betas, D, indY, J, Jvals, lk, namearray, NN, nX, X, Y
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 GQMNP : MNP : MultiNomialChoice : BlackBox : UnConstrained : Objective

Independent MNP using Gausss-Hermite integration.
Public fields
 Npts const # of nodes in quadrature
Public methods
 GQMNP Gauss-Hermite based objective for MNP log likelihood.
 vfunc Compute and return the vector of log-likelihoods at the current parameters.
Inherited methods from MultiNomialChoice:
Estimate, MultiNomialChoice, SetD
Inherited methods from BlackBox:
BlackBox
Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vobj
Inherited fields from MultiNomialChoice:
betas, D, indY, J, Jvals, lk, namearray, NN, nX, X, Y
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 MixPoint

Public methods
 aggregate

 Mixture : Separable : UnConstrained : Objective

Public fields
 D const # observed types, environment
 DK const D x K
 dkfree
 DKL const
 Dvar const Discrete environment-type var
 FinL
 Flabels
 Included matrix of indicators of valid d,k combos
 lfree
 mcur const
 nfree
 WStart
Public methods
 CheckMax virtual If scur.v > maxpt.v call Save and update maxpt.
 Decode virtual Decode and return the parameter array.
 Encode virtual .
 fobj Decode the input, compute the objective, check the maximum.
 funclist virtual Compute the objective at multiple points.
 Gradient virtual Compute the ∇f(), objective's gradient at the current vector.
 IncludedDK Indicate with (d,k) combinations should be computed.
 Jacobian virtual Compute the Jg(), vector version of the objective's Jacobian at the current vector.
 Mixture Create a mixture objective.
 vfunc virtual
 vobj virtual Decode the input, return the whole vector.
 WDecode
 WEncode
 Wfunclist virtual
Inherited methods from Separable:
Common, Separable
Inherited methods from UnConstrained:
UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMaxV, CheckPoint, contour, FreeStatus, Hessian, Interact, Load, Menu, Objective, Parameters, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams
Inherited fields from Separable:
C, CDNV, ComInd, K, kfree, KL, kNvf, Kvar, NvfuncTerms, scur
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nstruct, once, p2p, PsiL, PsiType, RunSafe, subp2p, vcur, Volume, Warned

 MLogit : MultiNomialChoice : BlackBox : UnConstrained : Objective

Multinomial Logit Model.
Public methods
 MLogit Create a multinomial logit model.
 vfunc Return the log-likelihood vector.
Inherited methods from MultiNomialChoice:
Estimate, MultiNomialChoice, SetD
Inherited methods from BlackBox:
BlackBox
Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vobj
Inherited fields from MultiNomialChoice:
betas, D, indY, J, Jvals, lk, namearray, NN, nX, X, Y
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 MNP : MultiNomialChoice : BlackBox : UnConstrained : Objective

Container for normally-distributed multinomial discrete choice reduced-form models.
Inherited methods from MultiNomialChoice:
Estimate, MultiNomialChoice, SetD
Inherited methods from BlackBox:
BlackBox
Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vfunc, vobj
Inherited fields from MultiNomialChoice:
betas, D, indY, J, Jvals, lk, namearray, NN, nX, X, Y
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 MultiNomialChoice : BlackBox : UnConstrained : Objective

Objective for multinomial choice models.
Public fields
 betas const Array of J-1 parameter blocks, one for each equation except Y=0.
 D matrix of XB indices.
 indY const N x J matrix of permutations
the first column is index of Y
second column is first non-Y choice
third column is second non-Y choice
etc.
 J const J : number of options
 Jvals const integer codes of choices
 lk vector or matrix of likelihods.
 namearray const Labels for variables
 NN const indexing vector
 nX const K : number of X variables
 X const X : matrix of exog variables
 Y const Y : discrete endog vector
Public methods
 Estimate
 MultiNomialChoice Create a new Multinomial Choice Model model.
 SetD Update \(XB\) matrix of indices by observation and option.
Inherited methods from BlackBox:
BlackBox
Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vfunc, vobj
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 NoObjective : BlackBox : UnConstrained : Objective

Public fields
 model
 modelmethod
 v
Public methods
 NoObjective A wrapper that acts like an objective but just calls a model's Solve method and returns 1.0.
 vfunc
Inherited methods from BlackBox:
BlackBox
Inherited methods from UnConstrained:
Gradient, UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vobj
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 Objective

Base class for objective optimization and system solving.
Public fields
 DoNotConstrain This objective uses raw parameter values.
 dStepLinearGap static const
 EXT static const Extension for Load and Save files, =optobj.
 Flabels array free parameter labels
 fname const Name for Load & files
 fshold holds DoNotVary vector for temp.
 INGRADIENT TRUE when computing Gradient, can be used by semi-closed form gradient methods.
 L const label.
 logf log file
 lognm const name of log file
 maxpt const Best so far
 MyVersion static Version of niqlow that code is written for.
 newmax Set in CheckMax(), TRUE if latest check was new max.
 nfree length of F in current cycle.
 nstruct length of X.
 NvfuncTerms Longest vector returned by vfunc(), default=1.
 once TRUE if encoded once
 p2p P2P object for using MPI across param vectors
 PsiL all parameter labels
 PsiType parameter class names
 RunSafe TRUE (default): exit if NaNs encountered during iteration
FALSE: exit with IterationFailed
 Start Initial vector after Encode()
 subp2p P2P object for MPI on a single param vector.
 vcur const current point.
 Volume Output Level.
 Warned static .
Public methods
 AggSubProbMat virtual
 Block virtual
 CheckMax virtual If vcur.v > maxpt.v call Save() and update maxpt.
 CheckMaxV Compare v to maxpt.
 CheckPoint virtual Load or save state of the problem to a file.
 contour virtual Graph the level curves of the objective in two parameters.
 Decode virtual Decode a vector of free variables.
 Encode virtual Encode vector of structural parameters.
 fobj virtual Decode the input, compute the objective, check the maximum.
 FreeStatus Preserve the state of free or fixed status of the parameter vector.
 funclist virtual Compute the objective at multiple points.
 Gradient virtual Compute the ∇f(), objective's gradient at the current vector.
 Hessian virtual Compute the Hf(), Hessian of objective at the current vector.
 Interact virtual
 Jacobian virtual Compute the Jg(), vector version of the objective's Jacobian at the current vector.
 Load Load state of the problem.
 Menu virtual
 Objective Create a new objective.
 Parameters virtual Add Parameters to the parameter list to be optimized over.
 Print virtual Prints a message and details about the objective.
 Recode virtual Reset the free parameter vector and the complete structural parameter vector.
 ReInitialize virtual Revert all parameters to their hard-coded initial values.
 ResetMax virtual Reset the value of the current and maximum objective.
 Save Store current state (checkpoint to disk).
 SetAggregation Set the formula .
 SetVersion static Checks the version number you send with the current version of niqlow.
 ToggleBlockElements virtual Toggle DoNotVary for one or more parameters.
 ToggleParameterConstraint Toggle the value of DoNotConstrain.
 ToggleParams virtual Toggle DoNotVary for one or more parameters.
 vfunc virtual Built in objective, f(ψ).
 vobj virtual Decode the input, return the whole vector.

 OneDimSystem : System : Objective

A One Dimensional Non-linear system (can be solved with OneDimSolve).
Public fields
 ipar
 isys
 msys const
Public methods
 CheckMax This is misnamed.
 OneDimSystem Create a new non-linear equation.
 ResetMax Reset the value of the system.
 SetOneDim
 vfunc virtual
Inherited methods from System:
EndOneDim, equations, System
Inherited methods from Objective:
AggSubProbMat, Block, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Gradient, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vobj
Inherited fields from System:
eq1, normexp
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 Separable : UnConstrained : Objective

Represent sum of K BlackBox objectives.
Public fields
 C Number of common parameters
 CDNV
 ComInd Vector of indices into Psi of common pars
 Flabels .
 Included
 K const # unobserved types, sub-problems
 kfree K Vector of free specific parameters
 KL const labels for types / sub problems
 kNvf
 Kvar const Discrete sub-problem var
 nfree Total free parameters
 NvfuncTerms Longest vector returned by vfunc(), default=1.
 scur const
Public methods
 CheckMax virtual If scur.v > maxpt.v call Save and update maxpt.
 Common virtual Add parameters to the objective that will have a single value across types/sub-problems.
 Decode virtual Decode and return the structural parameter matrix.
 Encode virtual Encode matrix of structural parameters.
 fobj virtual Decode the input, compute the objective, check the maximum.
 funclist virtual Compute the objective at multiple points.
 Gradient virtual Compute the ∇f(), objective's gradient at the current vector.
 Jacobian virtual Compute the Jg(), vector version of the objective's Jacobian at the current vector.
 Print virtual .
 Separable Create a separable objective.
 vfunc virtual
 vobj virtual Decode the input, return the whole vector.
Inherited methods from UnConstrained:
UnConstrained
Inherited methods from Objective:
AggSubProbMat, Block, CheckMaxV, CheckPoint, contour, FreeStatus, Hessian, Interact, Load, Menu, Objective, Parameters, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nstruct, once, p2p, PsiL, PsiType, RunSafe, subp2p, vcur, Volume, Warned

 System : Objective

A non-linear system of equations to solve.
Public fields
 eq1 1 equation of system.
 normexp
Public methods
 EndOneDim
 equations virtual Default system of equations: vfunc().
 SetOneDim virtual
 System Create a new system of equations object.
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Gradient, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vfunc, vobj
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 UnConstrained : Objective

Container for Unconstrained Objectives.
Public methods
 Gradient virtual Compute the ∇f(), objective's gradient at the current vector.
 UnConstrained Create an unconstrained objective.
Inherited methods from Objective:
AggSubProbMat, Block, CheckMax, CheckMaxV, CheckPoint, contour, Decode, Encode, fobj, FreeStatus, funclist, Hessian, Interact, Jacobian, Load, Menu, Objective, Parameters, Print, Recode, ReInitialize, ResetMax, Save, SetAggregation, SetVersion, ToggleBlockElements, ToggleParameterConstraint, ToggleParams, vfunc, vobj
Inherited fields from Objective:
DoNotConstrain, dStepLinearGap, EXT, Flabels, fname, fshold, INGRADIENT, L, logf, lognm, maxpt, MyVersion, newmax, nfree, nstruct, NvfuncTerms, once, p2p, PsiL, PsiType, RunSafe, Start, subp2p, vcur, Volume, Warned

 Global

Enumerations
MixedWeightOptions Tags weighting options. EqualInitialWeights, SimplexWeights, FixedWeights, MixedWeightOptions
QuasiAlgorithms Tags for Gradient-based optimization algorithms. USEBHHH, USEBFGS, USEDFP, USESTEEP, USENEWTON, QuasiAlgorithms

 BlackBox

 BlackBox

BlackBox :: BlackBox ( L )
Create a blackbox objective.
Parameters:
L string, a label for the problem.

 CES

 A

decl A [public]

 alphas

decl alphas [public]

 CES

CES :: CES ( L , alphas , elast , A , labels )
Create a constant elasticity of subsitution objective.
Parameters:
L label
alphas CV-compatiable vector of weights/shares. Default is <0.5;0.5>
elast elasticity parameter ε. The exponent on each input is computed as (elast-1)/elast. Default is -2.0
A constant term (TFP). Default is 1.0
labels 0 or array of labels for arguments.

$$A\left( {\sum}_{i=1}^N \alpha_ix_i^s \right)^{1/s}$$

$$s \equiv {\epsilon-1 \over \epsilon}.$$

Comments:
Sets the parameter vector \(x\) equal to StDeviations of the same dimension as alphas. This means it will enforce positive values by transformations. If gradients needed to be computed in terms of the structural input values, then toggle the parameter constraints for the objective:

    U = new CES("U");
    U -> ToggleParameterConstraint();
    

 elast

decl elast [public]

 vfunc

virtual CES :: vfunc ( )
Compute CES. \(A \left[{\sum} \alpha_i x_i^\sigma\right ]^{1/\sigma}.\) \(sigma \equiv (\eta-1)/\eta\)

 x

decl x [public]

 xpon

decl xpon [public]

 CobbDouglas

 A

decl A [public]

 alphas

decl alphas [public]

 AnalyticGradient

virtual CobbDouglas :: AnalyticGradient ( )

 CobbDouglas

CobbDouglas :: CobbDouglas ( L , alphas , A , labels )
Create a CobbDouglas objective.
Parameters:
L label
alphas CV-compatiable vector of exponents.
labels 0 or array of labels for arguments.

Sets the parameter vector as \(x\) equal to StDeviations of the same dimension as alphas

$$A{\prod}_{i=1}^N x_i^{\alpha_i}$$


 vfunc

virtual CobbDouglas :: vfunc ( )
\(A{\prod}_{i=1}^N x_i^{\alpha_i}\).

 x

decl x [public]

 Constrained

 CheckPoint

virtual Constrained :: CheckPoint ( f , saving )
Store current state of a Constrained Objective (checkpoint to disk).
Parameters:
f
saving
Comments:
the value of vcur.F is written to the file but ignored by Load().

 Constrained

Constrained :: Constrained ( L , ELorN , IELorN )
Create a constrained objective.
Parameters:
L label
ELorN Number of equality constraints (integer, array of strings, string list of names)
IELorN Number of inequality constraints

 equality

virtual Constrained :: equality ( )
Default Equality Constraints.
Returns:
empty vector

 funclist

Constrained :: funclist ( Fmat , jake )
Compute the objective and constraints at multiple points.
Parameters:
Fmat, Nf×J matrix of column vectors to evaluate at
Returns:
J, the number of function evaluations

 Gradient

virtual Constrained :: Gradient ( extcall )
Compute the ∇f(), objective's gradient at the current vector.

 inequality

virtual Constrained :: inequality ( )
Default InEquality Constraints.
Returns:
empty vector

 Jacobian

virtual Constrained :: Jacobian ( )
Compute the Jg(), vector version of the Lagrangian's Jacobian at the current vector.

 Lagrangian

Constrained :: Lagrangian ( F )
Decode the input, return the whole vector, inequality and equality constraints, if any.
Parameters:
F vector of free parameters.
Returns:
Array, {ƒ,g,h};

 Merit

virtual Constrained :: Merit ( F )

 CPoint

 Vec

CPoint :: Vec ( )

 DataObjective

 data

const decl data [public]
path or prediction object.

 DataObjective

DataObjective :: DataObjective ( L , data , ... )
An objective based on an economic model with data and (possibly) a nested solution method.
Parameters:
L string, label
data an object that includes member FN and method EconometricObjective.
Typically, OutcomeDataSet or PredictionDataSet object (including the possibility of the derived OutcomeDataSet and PredictionDataSet variety).
... Parameters and arrays of Parameters to optimize over.
Comments:
NvfuncTerms is set to data.FN, the total number of paths in the panel

 SetStage

DataObjective :: SetStage ( stage )
Set the estimation stage.
Parameters:
stage Zero, One or Two

Stage Zero:
Parameters on the uplist are set fixed.
Parameters on the tp list can vary .
Bellman iteration method is set to DoNotIterate
Stage One:
uplist variable
tplist fixed
Bellman DoNotIterate = FALSE
Object is reset
Stage Two:
Both parameter lists vary, method iterates

See also:
FPanel::method, PathPrediction::method, ResetMax, Method::DoNotIterate, DoNotVary

 stage

decl stage [public]
estimation stage.

 tplist

decl tplist [public]
transition parameters .

 TwoStage

DataObjective :: TwoStage ( intplist , inuplist )
Specify the objective as two stage.
Parameters:
tplist a Parameter or a list of parameters that affect the transition only. These will be estimated at Stage 0 or Stage 2
uplist a Parameter list of parameters that affect Utility only. These will be estimated at Stage 1 or Stage 2.
Comments:
These lists of parameters are added to the overall parameter list so should not be added separately. Parameters that were added when the data objective was created will not be affected by this. They should be toggled separately by the user's code.

 uplist

decl uplist [public]
utility parameters .

 vfunc

virtual DataObjective :: vfunc ( subp )
Calls and returns data->EconometricObjective() or uses SemiClosedForm() if in Gradient calculation.

 Equilibrium

 aggF

const decl aggF [public]
list of aggregate prod. function BlackBox.

 deprec

const decl deprec [public]
0.0 or vector of quantity depreciations.

 Equilibrium

Equilibrium :: Equilibrium ( L , T , P )
Create a system of aggregate equilibrium equations.
Parameters:
L label
T number of periods of static equilibria.
1 [default]
P an array of parameters or a parameter block of prices \(p\)
0 [default] a vector of StDeviations is created of the same length as the parameter list of aggF

This should be called in the creator function of a derived equilibrium class after the following constants have been initialized inside the creator:

  • aggF : must contain an Objective for the aggregate production function \(F(X^d)\). THe parameters of aggF are \(X^d\). They are set as DoNotConstrain so that the gradient is correct (not transformed).
  • stnpred : must contain a PathPrediction object that has a nested solution algorithm. It should typically be set to make predictions from the Ergodic distributions.
  • Qcols vector of indices into the prediction matrix that correspond to \(X^s\). If equal to 0 the first \(N\) columns will be selected in order.
  • deprec CV-compatible vector of input depreciations \(\Delta\)
    0 [default] no depreciation term

 foc

decl foc [public]
computed system.

 Print

Equilibrium :: Print ( orig , fn , toscreen )
Prints a message and details about the objective.
Parameters:
orig string, origin of the print call
fn integer, no print to file.
file, prints to file as well as screen
toscreen TRUE: print full report to screen as well
FALSE: only print orig to screen

 Q

decl Q [public]
aggregate Qs from prediction.

 Qcols

const decl Qcols [public]
columns of pred that match up to inputs.

 stnpred

const decl stnpred [public]
ergodic distribution PathPrediction.

 T

const decl T [public]
number of periods in equilibrium.

 vfunc

virtual Equilibrium :: vfunc ( )
Built-in system of equations for Equilibrium models. Typically the user's derived class does not need to replace this if takes the form below for their model:

 GHKMNP

Enumerations
Anonymous enum 1 identity, onlydiag, lowertriangle, SigmaOptions

 ghk

const decl ghk [public]

 GHKMNP

GHKMNP :: GHKMNP ( L , fn , Yname , Xnames , R , iSigma )
GHK based objective for MNP log likelihood.
Parameters:
L
fn
Yname
Xnames
iSigma

 SetGHK


 sigfree

const decl sigfree [public]

 SigLT

const decl SigLT [public]

 vfunc

GHKMNP :: vfunc ( )
Compute and return the vector of log-likelihoods at the current parameters.

 GQMNP

 GQMNP

GQMNP :: GQMNP ( L , fn , Yname , Xnames , Npts )
Gauss-Hermite based objective for MNP log likelihood.
Parameters:
Npts
fn
Yname
Xnames

 Npts

const decl Npts [public]
# of nodes in quadrature

 vfunc

GQMNP :: vfunc ( )
Compute and return the vector of log-likelihoods at the current parameters.

 MixPoint

 aggregate

MixPoint :: aggregate ( outV , v )

 Mixture

 CheckMax

virtual Mixture :: CheckMax ( fn )
If scur.v > maxpt.v call Save and update maxpt.
Parameters:
fn file name
Returns:
TRUE if maxval was updated
FALSE otherwise.

 D

const decl D [public]
# observed types, environment

 Decode

virtual Mixture :: Decode ( F )
Decode and return the parameter array.
Parameters:
F vector of free parameters.

 DK

const decl DK [public]
D x K

 dkfree

decl dkfree [public]

 DKL

const decl DKL [public]

 Dvar

const decl Dvar [public]
Discrete environment-type var

 Encode

virtual Mixture :: Encode ( inX )
.

 FinL

decl FinL [public]

 Flabels

decl Flabels [public]

 fobj

Mixture :: fobj ( F , extcall )
Decode the input, compute the objective, check the maximum.
Parameters:
F vector of free parameters.
Returns:
mcur.v, f(ψ)

 funclist

virtual Mixture :: funclist ( Fmat , aFvec )
Compute the objective at multiple points.
Parameters:
Fmat, Nf×J matrix of column vectors to evaluate at
aFvec, address of a ?×J matrix to return f() in.
afvec, 0 or address to return aggregated values in.
Returns:
J, the number of function evaluations

 Gradient

Compute the ∇f(), objective's gradient at the current vector.
Returns:
scur.G

 Included

decl Included [public]
matrix of indicators of valid d,k combos

 IncludedDK

Mixture :: IncludedDK ( mDK )
Indicate with (d,k) combinations should be computed.
Parameters:
mDK D×K matrix of 0s/1s
Comments:
default is ones(D,K)

 Jacobian

virtual Mixture :: Jacobian ( )
Compute the Jg(), vector version of the objective's Jacobian at the current vector.
Returns:
Jg(ψ)

 lfree

decl lfree [public]

 mcur

const decl mcur [public]

 Mixture

Mixture :: Mixture ( L , Dvar , Kvar , MixType , ... )
Create a mixture objective.
Parameters:
L string, a label for the problem.
Dvar, integer>0, the number of environments
Discrete variable that codes the environment
Kvar, integer>0, the number of types
Discrete variable that codes the types
MixType, MixedWeightOptions
... D×K matrix or D-array of values
No optional argument means
Lambda[d] = new Simplex("L"+sprint("%2u",d),K), for d = 0, … D‾
A single argument, then it must be a D×K matrix
Lambda[d] = new Simplex("L"+sprint("%2u",d),va[0][d][]), for d = 0, … D‾
D arguments, then each must be a ParameterBlock of size K and
Lambda[d] = va[d] for d = 0, … D‾

 nfree

decl nfree [public]

 vfunc


 vobj

virtual Mixture :: vobj ( F )
Decode the input, return the whole vector.
Parameters:
F vector of free parameters.

 WDecode

Mixture :: WDecode ( WF )

 WEncode

Mixture :: WEncode ( inW )

 Wfunclist


 WStart

decl WStart [public]

 MLogit

 MLogit

MLogit :: MLogit ( L , fn , Yname , Xnames )
Create a multinomial logit model.
Parameters:
L label
fn string, a file to load the data from using Ox Database.Load()
Yname string, name or label of the column in the file that contains Y
Yname can contain any integers. MNP will translate the unique sorted values into 0...Jvals-1
Xnames a string of the form var1 var2 ... varN

 vfunc

MLogit :: vfunc ( )
Return the log-likelihood vector.

 MultiNomialChoice

 betas

const decl betas [public]
Array of J-1 parameter blocks, one for each equation except Y=0.

 D

decl D [public]
matrix of XB indices.

 Estimate


 indY

const decl indY [public]
N x J matrix of permutations
the first column is index of Y
second column is first non-Y choice
third column is second non-Y choice
etc.

 J

const decl J [public]
J : number of options

 Jvals

const decl Jvals [public]
integer codes of choices

 lk

decl lk [public]
vector or matrix of likelihods.

 MultiNomialChoice

MultiNomialChoice :: MultiNomialChoice ( L , fn , Yname , Xnames )
Create a new Multinomial Choice Model model.
Parameters:
L label
fn string, a file to load the data from using Ox Database.Load()
Yname string, name or label of the column in the file that contains Y
Yname can contain any integers. MNP will translate the unique sorted values into 0...Jvals-1
Xnames a string of the form var1 var2 ... varN
Comments:
Observations with any missing data are deleted.
A constant column is appended at the end of the X matrix as in Stata.
Summary statistics are reported.
Written with help from Stefan Fassler and Tanvir Ahmed Khan Tanu

 namearray

const decl namearray [public]
Labels for variables

 NN

const decl NN [public]
indexing vector

 nX

const decl nX [public]
K : number of X variables

 SetD

MultiNomialChoice :: SetD ( )
Update \(XB\) matrix of indices by observation and option.

 X

const decl X [public]
X : matrix of exog variables

 Y

const decl Y [public]
Y : discrete endog vector

 NoObjective

 model

decl model [public]

 modelmethod

decl modelmethod [public]

 NoObjective

NoObjective :: NoObjective ( model )
A wrapper that acts like an objective but just calls a model's Solve method and returns 1.0.
Parameters:
model Object with a method named Solve() or a member named method with a method named Solve()

 v

decl v [public]

 vfunc

NoObjective :: vfunc ( subp )

 Objective

 AggSubProbMat

virtual Objective :: AggSubProbMat ( submat )

 Block


 CheckMax

virtual Objective :: CheckMax ( fn )
If vcur.v > maxpt.v call Save() and update maxpt.
Parameters:
fn file name
Returns:
TRUE if maxval was updated
FALSE otherwise.
See also:
CheckMaxV

 CheckMaxV

Objective :: CheckMaxV ( v , fn )
Compare v to maxpt.
Parameters:
v value of objective
fn file name to print to Output is determined by Volume

 CheckPoint

virtual Objective :: CheckPoint ( f , saving )
Load or save state of the problem to a file.
Parameters:
f file object
saving TRUE: save status to the file
FALSE: load from the file and close it, call Encode

 contour

virtual Objective :: contour ( Npts , Xpar , Ypar , lims )
Graph the level curves of the objective in two parameters.
Parameters:
Npts integer [default=100], number of points to evaluate in each dimensions
Xpar Parameter for the x axis
Ypar Parameter for the y axis
lims 2×2 matrix of upper and lower bounds for axes

 Decode

virtual Objective :: Decode ( F )
Decode a vector of free variables. Converts an optimized parameter vector into the structural parameter vector. Ensure that each parameter and each parameter block current value is updated.
Parameters:
F, nfree x 1 vector of optimized parameters.
0 [default], use vcur.F for decode

 DoNotConstrain

decl DoNotConstrain [public]
This objective uses raw parameter values.

 dStepLinearGap

static const decl dStepLinearGap [public]

 Encode

virtual Objective :: Encode ( inX )
Encode vector of structural parameters.
Parameters:
inX 0 [default] get new starting values from the parameters
a vector, new starting values.

Comments:
if X is a vector
then a value of .NaN means that parameter should be held fixed at the current value during this cycle of optimization.
If X=0 then the starting values are retrieved as follows:
If this is the first call of Encode() the initial values passed to the parameters when they were created.
If this.X already has elements then this is not the first call to Encode() and starting values will be retrieved from the current values of parameters.
See also:
Recode, nfree, nstruct, FinX

 EXT

static const decl EXT [public]
Extension for Load and Save files, =optobj.

 Flabels

decl Flabels [public]
array free parameter labels

 fname

const decl fname [public]
Name for Load & files

 fobj

virtual Objective :: fobj ( F , extcall )
Decode the input, compute the objective, check the maximum.
Parameters:
F vector of free parameters.
extcall TRUE [default] go into server mode if MPI server, send Stop if client

 FreeStatus

Objective :: FreeStatus ( Store )
Preserve the state of free or fixed status of the parameter vector.
Parameters:
Store TRUE, store the current status
FALSE restore after a previous store

See also:
ToggleParams, ToggleBlockElements

 fshold

decl fshold [public]
holds DoNotVary vector for temp. 1-d solution.

 funclist

virtual Objective :: funclist ( Fmat , aFvec , afvec , abest )
Compute the objective at multiple points.
Parameters:
Fmat, Nf×J matrix of column vectors to evaluate at
aFvec, address of a ?×J matrix to return f() in.
afvec, 0 or address to return aggregated values in (as a 1 × J ROW vector)
abest, 0 or address to return index of best vector

The maximum value is also computed and checked.

Returns:
J, the number of function evaluations

 Gradient

virtual Objective :: Gradient ( extcall )
Compute the ∇f(), objective's gradient at the current vector.
Parameters:
extcall [default=TRUE]. if running in parallel Stop message sent out
Compute
$$\nabla f(\psi)$$ Stored in vcur.G

Any derived Objective can replace this virtual method with one that computes analytic gradients or other approaches.

Returns:
vcur.G

 Hessian

virtual Objective :: Hessian ( )
Compute the Hf(), Hessian of objective at the current vector.
Returns:
Hg(ψ) in vcur.H

 INGRADIENT

decl INGRADIENT [public]
TRUE when computing Gradient, can be used by semi-closed form gradient methods.

 Interact


 Jacobian

virtual Objective :: Jacobian ( )
Compute the Jg(), vector version of the objective's Jacobian at the current vector.
Returns:
Jg(ψ) in vcur.J

 L

const decl L [public]
label.

 Load

Objective :: Load ( fname )
Load state of the problem.
Parameters:
fname string, name of file
0 [default], use the default name, the label with spaces removed
-1, do nothing and return FALSE.
Returns:
TRUE if parameter values were loaded from file
FALSE otherwise.
Comments:
FinX is read in to set DONOTVARY for each parameter. The value of F is ignored by Load. Encode() called by Load.
See also:
Save, L

 logf

decl logf [public]
log file

 lognm

const decl lognm [public]
name of log file

 maxpt

const decl maxpt [public]
Best so far
See also:
CheckMax

 Menu

virtual Objective :: Menu ( )

 MyVersion

static decl MyVersion [public]
Version of niqlow that code is written for.
See also:
SetVersion

 newmax

decl newmax [public]
Set in CheckMax(), TRUE if latest check was new max.

 nfree

decl nfree [public]
length of F in current cycle.

 nstruct

decl nstruct [public]
length of X.

 NvfuncTerms

decl NvfuncTerms [public]
Longest vector returned by vfunc(), default=1.

 Objective

Objective :: Objective ( L , CreateCur )
Create a new objective.
Parameters:
L string, label for the objective.
CreateCur create a new Point in vcur

 once

decl once [public]
TRUE if encoded once

 p2p

decl p2p [public]
P2P object for using MPI across param vectors

 Parameters

virtual Objective :: Parameters ( ... )
Add Parameters to the parameter list to be optimized over.
Parameters:
... the first or next (and possibly only) parameter to add to the objective
array: any argument can send an array which contains only parameters and blocks
See also:
Parameter, Psi

 Print

virtual Objective :: Print ( orig , fn , toscreen )
Prints a message and details about the objective.
Parameters:
orig string, origin of the print call
fn integer, no print to file.
file, prints to file as well as screen
toscreen TRUE: print full report to screen as well
FALSE: only print orig to screen

 PsiL

decl PsiL [public]
all parameter labels

 PsiType

decl PsiType [public]
parameter class names

 Recode

virtual Objective :: Recode ( HardCode )
Reset the free parameter vector and the complete structural parameter vector.
Parameters:
HardCode TRUE=hard-coded parameter values used.
FALSE [default] Start vector used Must be called anytime a change in constraints is made. So it is called by Encode() and ReInitialize()

 ReInitialize

virtual Objective :: ReInitialize ( )
Revert all parameters to their hard-coded initial values. This routine can only be called after Encode() has been called.

All parameters are reset to their hard-coded initial values, stored as ival.

This also sets the values of the vcur vector, including the structural parameters X and free parameters F

ResetMax() is called

The result is as if no optimization has occurred and Encode(0) has just been executed for the first time.


 ResetMax

virtual Objective :: ResetMax ( )
Reset the value of the current and maximum objective.

 RunSafe

decl RunSafe [public]
TRUE (default): exit if NaNs encountered during iteration
FALSE: exit with IterationFailed

 Save

Objective :: Save ( fname )
Store current state (checkpoint to disk).
Parameters:
fname string, name of file
0 [default] use fname
See also:
Load, EXT

 SetAggregation

Objective :: SetAggregation ( AggType )
Set the formula .
Parameters:
AggType
See also:
AggregatorTypes

 SetVersion

static Objective :: SetVersion ( v )
Checks the version number you send with the current version of niqlow.
Parameters:
v integer [default=200]

 Start

decl Start [public]
Initial vector after Encode()

 subp2p

decl subp2p [public]
P2P object for MPI on a single param vector.

 ToggleBlockElements

virtual Objective :: ToggleBlockElements ( pblock , elements )
Toggle DoNotVary for one or more parameters.
Parameters:
pblock ParameterBlock
elements vector of indices of block elements to toggle.

 ToggleParameterConstraint

Objective :: ToggleParameterConstraint ( )
Toggle the value of DoNotConstrain. If DoNotConstrain then all parameters except Determined parameters are free and unscaled. This can improve convergence near the top of the objective. It also means that the Hessian values are in terms of the economic parameters not the free-to-vary optimization parameters.

 ToggleParams

virtual Objective :: ToggleParams ( ... )
Toggle DoNotVary for one or more parameters.
Parameters:
... Parameters or arrays of parameter

To toggle elements of a parameter block ...

See also:
ToggleBlockElements

 vcur

const decl vcur [public]
current point.

 vfunc

virtual Objective :: vfunc ( subp )
Built in objective, f(ψ). Prints a warning once and then returns 0.

 vobj

virtual Objective :: vobj ( F )
Decode the input, return the whole vector.
Parameters:
F vector of free parameters.
Returns:
vcur.V

 Volume

decl Volume [public]
Output Level.

 Warned

static decl Warned [public]
. internal

 OneDimSystem

 CheckMax

OneDimSystem :: CheckMax ( fn )
This is misnamed. It checks whether the 1-D system is closer to 0.
Parameters:
fn file name

 ipar

decl ipar [public]

 isys

decl isys [public]

 msys

const decl msys [public]

 OneDimSystem

OneDimSystem :: OneDimSystem ( L , msys )
Create a new non-linear equation.
Parameters:
L label for the system.
msys System object that is the mother system
0 [default] no mother system

A system of this type can be solved using OneDimSolve


 ResetMax

OneDimSystem :: ResetMax ( )
Reset the value of the system. reversed sign from others.

 SetOneDim

OneDimSystem :: SetOneDim ( insys , inpar )
Parameters:
insys
inpar

 vfunc

virtual OneDimSystem :: vfunc ( )

 Separable

 C

decl C [public]
Number of common parameters

 CDNV

decl CDNV [public]

 CheckMax

virtual Separable :: CheckMax ( fn )
If scur.v > maxpt.v call Save and update maxpt.
Parameters:
fn file name
Returns:
TRUE if maxval was updated
FALSE otherwise.

 ComInd

decl ComInd [public]
Vector of indices into Psi of common pars

 Common

virtual Separable :: Common ( ... )
Add parameters to the objective that will have a single value across types/sub-problems.
Parameters:
... Parameter(s) and/or arrays of Parameters to add to the objective
Comments:
On any call to vfunc() common parameters will have the same value for each k.

 Decode

virtual Separable :: Decode ( F )
Decode and return the structural parameter matrix.
Parameters:
F vector of free parameters.
Returns:
X

 Encode

virtual Separable :: Encode ( X , CallBase )
Encode matrix of structural parameters.
Parameters:
X 0 get starting values from current X
vector N×1, common starting values across types
matrix N×K, starting values for all types. Only first column value used for common types
CallBase TRUE, simply call Encode(), used in parallel processing.
FALSE (default), proceed with separable encoding

 Flabels

decl Flabels [public]
.

 fobj

virtual Separable :: fobj ( F , extcall )
Decode the input, compute the objective, check the maximum.
Parameters:
F vector of free parameters.
Returns:
f(ψ)

 funclist

virtual Separable :: funclist ( Fmat , aFvec , afvec )
Compute the objective at multiple points.
Parameters:
Fmat, Nf×J matrix of column vectors to evaluate at
aFvec, address of a ?×J matrix to return f() in.
afvec, 0 or address to return aggregated values in.
Returns:
J, the number of function evaluations

 Gradient

virtual Separable :: Gradient ( extcall )
Compute the ∇f(), objective's gradient at the current vector.
Returns:
scur.G

 Included

decl Included [public]

 Jacobian

virtual Separable :: Jacobian ( )
Compute the Jg(), vector version of the objective's Jacobian at the current vector. Returns Jg(ψ) in cur.J.

 K

const decl K [public]
# unobserved types, sub-problems

 kfree

decl kfree [public]
K Vector of free specific parameters

 KL

const decl KL [public]
labels for types / sub problems

 kNvf

decl kNvf [public]

 Kvar

const decl Kvar [public]
Discrete sub-problem var

 nfree

decl nfree [public]
Total free parameters

 NvfuncTerms

decl NvfuncTerms [public]
Longest vector returned by vfunc(), default=1.

 Print

virtual Separable :: Print ( orig , fn , toscreen )
.

 scur

const decl scur [public]

 Separable

Separable :: Separable ( L , Kvar )
Create a separable objective.
Parameters:
L string, a label for the problem.
Kvar, integer>0, the number of sub objectives
Discrete variable that codes the problem
vector or ParameterBlock, weights on values of k

 vfunc


 vobj

virtual Separable :: vobj ( F )
Decode the input, return the whole vector.
Parameters:
F vector of free parameters.
Returns:
svfunc()

 System

 EndOneDim

System :: EndOneDim ( )

 eq1

decl eq1 [public]
1 equation of system.

 equations

virtual System :: equations ( )
Default system of equations: vfunc().

 normexp

decl normexp [public]

 SetOneDim

virtual System :: SetOneDim ( insys , inpar )
Parameters:
insys if eq1 an object then the equation index to select [default=0]
inpar if eq1 an object the parameter or parameter index to vary.

 System

System :: System ( L , LorN , incur )
Create a new system of equations object.
Parameters:
L label for the system.
LorN The size of the system indicated in 1 of 3 ways:
integer [default = 1], N the size of the system
array of length N, where each element is a string, the label for the equation.
string with N space-separate labels, the labels of the equations parsed by varlist.

Example:
Three ways to define a 3x3 system of equations:
 mysys = new System(3);
 mysys = new System({"A","B","C"});
 mysys = new System("Eq0 Eq2 Eq2");
See also:
NvfuncTerms, Equations

 UnConstrained

 Gradient

virtual UnConstrained :: Gradient ( extcall )
Compute the ∇f(), objective's gradient at the current vector.

Compute
∇ f(ψ)

Stored in vcur.G


 UnConstrained

UnConstrained :: UnConstrained ( L )
Create an unconstrained objective.
Parameters:
L label